package com.example.server.controller;

import com.example.server.pojo.MyRole;
import com.example.server.pojo.RespBean;
import com.example.server.service.FmcFarmBatchService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@Slf4j
@RequestMapping("/api")
public class FmcBatchCtl {
    @Autowired
    private FmcFarmBatchService fmcFarmBatchService;

    @ApiOperation(value = "查询角色权限")
    @GetMapping("/farmbatch/{farmid}")
    public RespBean farmbatch(@PathVariable("farmid") Long farmid) throws Exception {
        Map result = fmcFarmBatchService.updateFarmBatch(farmid);
        log.info("-----roleOfPower结果："+result);

        if (result != null){
            return new RespBean(200,"success",result);
        }else {
            return new RespBean(402,"获取员工失败",null);
        }
    }
}
